<script setup lang="ts">
// 模拟长列表数据
const listData = Array.from({ length: 10000 }, (_, index) => ({
    id: index,
    content: `Item ${index + 1}`,
}));
</script>
<template>
    <VirtualList :items="listData" :itemHeight="50" :buffer="5">
        <template #default="{ item }">
            <div class="custom-item">
                {{ item.data.content }}
            </div>
        </template>
    </VirtualList>
</template>

<style scoped lang="scss">
.custom-item {
    padding: 10px;
    border-bottom: 1px solid var(--ch2);
}
</style>
